	<!-- 直播话术 -->
	<template>
		<!-- listBg -->
		<view class="bg">
			<u-navbar title="直播话术" bgColor="#f9fcfe" placeholder autoBack>
				<view class="u-nav-slot" slot="right">
					<view class="closeBox dfx alc" @click="$tools.navTo('openLive/trick/add')">
						新增
						<image src="/static/img/openLive/add.png" style="width: 12px;height: 12px;margin-left: 3px;" mode=""></image>
					</view>
				</view>
			</u-navbar>

			<view class="ntitle df alc">
				<view class="" style="width: 25%;">
					<uni-data-select v-model="type" :clear="false" :localdata="vuex_status" @change="change"></uni-data-select>
				</view>
				<view class="ipt">
					<u--input placeholder="请输入" border="none" :customStyle="customStyle" v-model="name"></u--input>
				</view>
				<view class="search" @click="getData">
					搜索
				</view>
			</view>

			<trick :height="78" :liveList="livelist" @getData="reachBottom"></trick>

		</view>
	</template>

	<script>
		export default {
			data() {
				return {
					type: '',
					name: '',
					show: false,
					title: '',
					livelist: [],
					formInline: {
						page: 1,
						limit: 10,
						total: 0
					},
				};
			},
			onLoad() {
				this.getData()
			},
			onShow() {
				// this.getData()
			},
			methods: {
				reachBottom(page) {
					console.log(page);
					if (page == 0) {
						this.formInline = {
							page: 1,
							limit: 10,
							total: 0
						}
						this.getData();
					} else {
						if (this.formInline.total > this.livelist.length) {
							this.formInline.page++
							this.getData();
						}
					}

				},
				change(e) {
					this.type = e
					this.getData()
				},
				getData() {
					let params = {
						...this.formInline,
						type_s: 2,
						statusa: this.type
					}
					if (this.name) params.so = this.name
					uni.showLoading({
						title: '获取列表中'
					});
					this.$api.get_video_list(params).then(res => {
						uni.hideLoading()
						if (res.code == 200) {
							if (this.formInline.page == 1) {
								this.livelist = res.data.list
							} else {
								this.livelist = this.livelist.concat(res.data.list)
							}
							this.formInline.total = res.data.count
						} else {
							this.$tools.toast(res.msg);
						}
					})
				}

			}
		}
	</script>

	<style lang="less" scoped>
		.ntitle {
			background: #ffffff;
			border-radius: 16rpx;
			margin: 30rpx;
			// margin-bottom: 10rpx;
			padding: 24rpx;
			box-shadow: 1px 2px 10px rgba(20, 111, 255, 0.09);

			.ipt {
				// margin-top: 20rpx;

				/deep/.u-input {
					background: #f7fafc;
					height: 30px;
					width: 95%;
					margin: 0 auto;
					padding: 4px 8px !important;
				}
			}

			.search {
				width: 50px;
				height: 28px;
				color: #fff;
				margin-left: 10rpx;
				font-size: 26rpx;
				line-height: 28px;
				text-align: center;
				background: #146fff;
				border-radius: 32rpx;
			}
		}

		/deep/.uni-select {
			background: #f7fafc !important;
			border: 0;
		}
	</style>